package cn.qyd.javamap;

import com.sun.deploy.security.BadCertificateDialog;
import org.checkerframework.checker.units.qual.A;
import org.checkerframework.checker.units.qual.C;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 邱运铎
 * @date 2024-03-16 12:09
 */
public class ConcurrentHashMapDemo {
    public static void main(String[] args) {
        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        concurrentHashMap.put(1,1);
        HashMap hashMap = new HashMap();
        hashMap.put(1,1);
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put(1,1);
        HashSet hashSet = new HashSet();
        boolean add = hashSet.add(1);
        System.out.println(add);
        add = hashSet.add(1);
        System.out.println(add);
        hashSet.contains(1);
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        linkedHashSet.add(2);
        linkedHashSet.forEach(System.out::println);
        ArrayDeque arrayDeque = new ArrayDeque();
        arrayDeque.add(1);
        arrayDeque.add(2);
        arrayDeque.add(3);
        System.out.println("+++++++++++++++++");
        arrayDeque.forEach(System.out::println);
        arrayDeque.remove(2);
        System.out.println("+++++++++++++++++");
        arrayDeque.forEach(System.out::println);
        arrayDeque.remove(1);
        System.out.println("+++++++++++++++++");
        arrayDeque.forEach(System.out::println);
        arrayDeque.add(4);
        System.out.println("+++++++++++++++++");
        arrayDeque.forEach(System.out::println);
    }
}
